<template>
  <div class="home">
    <div class="beijingtu">
      <div class="beijingtu2">
        <div class="beijingtu3">
          <el-form class="center" ref="form" :model="form">
              <p class="center_title">登录</p>
              <div class="pub_box">
                  <el-form-item for="yx" class="public_fm" label="邮箱：" prop="email">
                      <el-input id="yx" class="public_ipt" placeholder="请输入邮箱" v-model="form.username"></el-input>
                  </el-form-item>
              </div>
              <div class="pub_box">
                  <el-form-item for="mm" class="public_fm" label="密码：" prop="password">
                      <el-input id="mm" class="public_ipt" placeholder="请输入密码" v-model="form.password"></el-input>
                  </el-form-item>
              </div>
              <el-form-item>
                <el-button id="sign" type="primary" @click="onSubmit()" >登录</el-button>
              </el-form-item>
              <p class="bottom">——————考试题库管理系统——————</p>
          </el-form>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import login from './index'
import axios from 'axios'
  export default {
    data() {
      return {
        form: {
            username: '',
            password: '',
        }
      }
    },
    methods: {
      onSubmit() {
        axios.post(`/api/login`,this.form).then(res=>{
            console.log(res.data); 
        })
        login()
      }
    }
  }
</script>

<style scoped>
  .beijingtu{
    width: 100%;
    background: url(../Login/004.png) no-repeat 50%;
    /* background: white url(./5f91018297909.jpg) no-repeat 50%; */
    min-height: 100%;
    position: relative;
    height: 100%;
    
  }
  .home{
    height: 100%;
  }
  .div1{
    height: 100%;
    width: 100%;
  }
  .center {
      width: 35.5%;
      height: 430px;
      max-width: 40%;
      background-color: white;
      /* background-color: #87CEEB; */
      border-radius:15px;
      margin-left: auto;
      margin-right: auto;
      border: solid;
      opacity: 0.8;
  }
  .center_title {
      font-size: 25px;
      padding-top: 30px;
      text-align: center;
  }
  .pub_box {
      width: 100%;
      margin: auto;
      margin-top: 30px;
  }
  .public_fm {
      padding-left: 8%;
  }
  .public_ipt {
      width: 75%;
      float: left;
  }
  #sign {
      margin-top: 20px;
      width: 89%;
      margin-left: 5.5%;
  }
  .bottom {
      font-size: 16px;
      color: darkgray;
      text-align: center;
      padding-top: 15px;
  }
  .public_ipt {
      width: 89%;
  }
  .beijingtu2{
      display: table;
      width: 100%;
      height: 100%;
  }
  .beijingtu3{
      display: table-cell;
      vertical-align: middle;
  }
</style>
